home *** CD-ROM | disk | FTP | other *** search
- on vaiVerbete arqNum, mediaNum
- global gVerbeteAtual
- -- put "vaiVerbete # carregando arquivo " & arqNum
- mSetCriteria(gVerbetes, "arqNum", "=", arqNum)
- mSelect(gVerbetes)
- set fichas = mSelectCount(gVerbetes)
- if fichas = 0 then
- set arqNum = 10000
- mSetCriteria(gVerbetes, "arqNum", "=", arqNum)
- mSelect(gVerbetes)
- set fichas = mSelectCount(gVerbetes)
- end if
- global gFotoCodes
- set gFotoCodes = ¬
- ["filenotfound", "filenotfound", ¬
- "filenotfound", "filenotfound", "filenotfound"]
-
- -- Verifica se existe verbete
- if fichas > 0 then
-
- -- Empilha arqNum na pilha de paginas visitadas
- empilhaArq arqNum
-
- sendSprite(120,#comecaAnima)
-
- -- Primeiro seta verbete atual, de acordo com grupo
- -- a que pertence
- global gEquipes, gHerois, gAstros
- global gVerbeteTipo
- global gAstroAtual, gEquipeAtual, gHeroiAtual
- if arqNum >= gAstros then
- set gAstroAtual = arqNum
- set gVerbeteTipo = 2
- else if arqNum >= gEquipes then
- set gEquipeAtual = arqNum
- set gVerbeteTipo = 1
- else
- set gHeroiAtual = arqNum
- set gVerbeteTipo = 0
- end if
-
- -- Desliga subtitulos/textos/"veja mais"/... antes
- repeat with i = 0 to 13 -- subtitulos texto basico
- set the visibility of sprite i+2 to false
- end repeat
- repeat with i = 0 to 13 -- linhas do texto basico
- set the visibility of sprite i+16 to false
- end repeat
- set the visibility of sprite 85 to false -- historico
- repeat with i = 0 to 7 -- "veja mais"
- set the visibility of sprite i+57 to false
- end repeat
- set the visibility of sprite 30 to false -- scroll bar sumario
- set the visibility of sprite 33 to false
- repeat with i = 79 to 82 -- Botoes Midias
- set the visibility of sprite i to false
- set the member of sprite i to ¬
- ((the number of member "Midias01") + i - 79)
- end repeat
- global gMidiaSelecionada
- set gMidiaSelecionada = 0
- repeat with i = 65 to 76 -- Texto/Subtitulos Midias
- set the visibility of sprite i to false
- end repeat
- set the visibility of sprite 78 to false -- Linhas Midias
- set the visibility of sprite 48 to false
- set the visibility of sprite 93 to false
- set the visibility of sprite 84 to false -- Indicador scroll Midias
- set the editable of sprite 45 to false -- Desliga cursor no numero¬
- -- do sprite
-
- -- Vai p/ frame de verbetes
- go frame "Verbetes"
-
- -- Arruma tipo de verbete
- sendSprite(44,#muda) -- Bitmap do tipo do verbete
- sendSprite(54,#muda) -- Animacao do tipo do verbete
- puppetSprite 86, true -- Tela de espera na foto
- set the member of sprite 86 to member "esperando"
- updateStage
-
- -- Percorre as diversas midias
- repeat with i = 1 to fichas
-
- -- Mostra midias disponiveis
- set mediaNum = mGetField(gVerbetes,"mediaNum")
- if mediaNum = 2 then
- set the visibility of sprite 79 to true
- else if mediaNum = 4 then
- set the visibility of sprite 80 to true
- else if mediaNum = 8 then
- set the visibility of sprite 81 to true
- else if mediaNum = 16 then
- set the visibility of sprite 82 to true
- end if
-
- -- Seta codigos de fotos
- set fotoCode = mGetField(gVerbetes, "fotoCode")
- if fotoCode = "x" then set fotoCode = "filenotfound"
- case mediaNum of
- 1:
- set base = the number of member 11 of castLib "Verbetes"
- setAt gFotoCodes, 5, fotoCode
- if fotoCode = "filenotfound" then
- set the member of sprite 86 to member fotoCode
- else
- global gSepPath
- importFileInto member 5, ¬
- the moviePath & "Fotos" & gSepPath & fotoCode & ".jpg"
- set the member of sprite 86 to member 5
- end if
- 2:
- set base = the number of member "tv0"
- setAt gFotoCodes, 1, fotoCode
- 4:
- set base = the number of member "cinema0"
- setAt gFotoCodes, 2, fotoCode
- 8:
- set base = the number of member "hq0"
- setAt gFotoCodes, 3, fotoCode
- 16:
- set base = the number of member "outras0"
- setAt gFotoCodes, 4, fotoCode
- otherwise beep
- end case
-
- -- Carrega textos
- repeat with counter = 0 to 17
- sendSprite(120,#idleClaquete)
- set mNum = mGetField(gVerbetes, "texto" & counter)
- set res = leMedia(mNum, base+counter)
- if (res < 0) then
- beep
- put "Erro lendo arquivo " & arqNum & ", midia " & mediaNum &¬
- ", subtitulo " & counter & " # " & res
- else if res <> 1 then
- set the lineHeight of member (base+counter) to 16
- if counter = 0 or mediaNum <> 1 then
- set the foreColor of member (base+counter) to¬
- (the backColor of member "FundoBranco")
- else
- set the foreColor of member (base+counter) to¬
- (the backColor of member "FundoPreto")
- end if
- if counter = 1 then
- set the fontStyle of member (base+counter) to "bold"
- end if
- end if
- end repeat
-
- -- Atualiza numero atual do verbete
- put arqNum into gVerbeteAtual
- set the text of member "numVerbete" to String(arqNum-9999)
-
- -- Lista subtextos
- listaSubTextos 0
-
- -- Continua a percorrer midias
- mGoNext(gVerbetes)
- end repeat
-
-
- -- Carrega links/veja mais
- global gLinks, gLinksCount, gLinksTable, gLinksDest
- global gVejaMais, gVejaMaisTitulos, gVejaMaisDest
-
- -- Inicializa links
- mSetCriteria(gLinks,"arqNum","=",arqNum)
- mSelect(gLinks)
- set gLinksCount = mSelectCount(gLinks)
- set gLinksTable = []
- set gLinksDest = []
- set gLinksTitle = []
-
- -- Inicializa veja mais
- set gVejaMais = 0
- set gVejaMaisTitulos = []
- set gVejaMaisDest = []
-
- if gLinksCount > 0 then
- set links = gLinksCount
- set gLinksCount = 0
- set mem = the number of member "VejaMais"
- -- mSetIndex(gArqs,"arqNdx")
- repeat with i = 1 to links
-
- sendSprite(120,#idleClaquete)
-
- -- Le registro de link
- set mNum = mGetField(gLinks, "mediaNum")
- set sNum = mGetField(gLinks, "subtitNum")
- set pNum = mGetField(gLinks, "palNum")
- set destArq = mGetField(gLinks,"destArq")
-
- -- Coloca registro na tabela
- set tmp = String(mNum) & "," & String(sNum) & "," &¬
- String(pNum)
- add gLinksTable, tmp
- add gLinksDest, destArq
- mGoNext(gLinks)
-
- -- Verifica se destino ja existe em veja mais
- set repetido = false
- set j = 1
- repeat while j <= gVejaMais and not repetido
- if destArq = getAt(gVejaMaisDest,j) then
- set repetido = true
- end if
- set j = j + 1
- end repeat
- if not repetido then
- -- Coloca novo registro nos "VejaMais"
- set gVejaMais = gVejaMais + 1
- add gVejaMaisDest, destArq
- mSetCriteria(gArqs,"arqNum","=",destArq)
- mSelect(gArqs)
- if mSelectCount(gArqs) > 0 then
- set tmp = mGetField(gArqs,"arquivo")
- else
- put "*** Erro, link para arquivo " & destArq
- set tmp = "Link inválido"
- end if
- -- Tira espaco no final de tmp
- set k = length(tmp)
- repeat while k > 0 and char k of tmp = SPACE
- set k = k - 1
- end repeat
- set tmp = char 1 to k of tmp
- add gVejaMaisTitulos, tmp
- end if
-
- end repeat
-
- end if
- sendSprite(88, #setPaginas, (gVejaMais+7)/8)
- if gVejaMais > 0 then
- sendSprite(88, #setBranco, 1)
- end if
-
- -- Religa subtitulos/textos/links
- repeat with i = 0 to 13
- set the visibility of sprite i+2 to true
- end repeat
- repeat with i = 0 to 13
- set the visibility of sprite i+16 to true
- end repeat
- set the visibility of sprite 85 to true
- repeat with i = 0 to gLinksCount - 1
- set the visibility of sprite i + 57 to true
- end repeat
-
- sendSprite(120,#finalizaAnima)
-
- updateStage
-
- return true
-
-
-
-
- -- Se nao encontrou verbete na base de dados
- -- simplesmente retorna false
- else
- return false
- end if
- end
-
- on prevVerbete
- global gVerbeteAtual, gVerbeteUltimo
-
- put gVerbeteAtual into i
- if i < 10001 then put 10001 into i
- if i > gVerbeteUltimo then put gVerbeteUltimo into i
- put false into res
- repeat while (not res) and i > 10000
- put i - 1 into i
- put vaiVerbete(i,1) into res
- end repeat
- end
-
- on proxVerbete
- global gVerbeteAtual, gVerbeteUltimo
-
- put gVerbeteAtual into i
- if i < 10000 then put 10000 into i
- if i > gVerbeteUltimo then put gVerbeteUltimo into i
- put false into res
- repeat while (not res) and i < gVerbeteUltimo
- put i + 1 into i
- put vaiVerbete(i,1) into res
- end repeat
- end
-
- on fazVejaMais pag
- global gVejaMais, gVejaMaisDest, gVejaMaisTitulos
- set k = (pag - 1) * 8 + 1
- set spr = 57
- repeat with i = k to k + 7
- if i > gVejaMais then
- set the visibility of sprite (i - k + spr) to false
- else
- set mem = the member of sprite (i - k + spr)
- set the text of member mem to getAt(gVejaMaisTitulos, i)
- set the foreColor of member mem to ¬
- (the backColor of member "FundoCinza")
- sendSprite(i-k+spr,#setLink,getAt(gVejaMaisDest,i))
- set the visibility of sprite (i - k + spr) to true
- end if
- end repeat
- end